import request from '@/utils/request'

// 获取手机验证码
export const sendSms = mobile => {
    return request({
      method: 'GET',
      url: `/v1_0/sms/codes/${mobile}`
    })
}
  
// 通过验证 获取用户 user_token
  export const identCheck = data => {
    return request({
      method: 'POST',
      url: '/v1_0/authorizations',
      data
    })
  }

  // 根据 user_token 获取当前登录用户信息
export const getUserInfo = () => {
    return request({
      method: 'GET',
      url: '/v1_0/user/profile'
    })
  }
// 获取当前登录用户的个人资料
export const getUserProfile = () => {
  return request({
    method: 'GET',
    url: '/v1_0/user/profile'
  })
}
  // 更新用户资料
export const updateUserProfile = data => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/profile',
    data
  })
}
// 更新用户照片资料
export const updateUserPhoto = data => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/photo',
    data
  })
}
